// utils/fullscreen.js
export const enterFullscreen = (element: any) => {
    if (element.requestFullscreen) {
        return element.requestFullscreen();
    } else if (element.mozRequestFullScreen) { // Firefox
        return element.mozRequestFullScreen();
    } else if (element.webkitRequestFullscreen) { // Chrome, Safari, Opera
        return element.webkitRequestFullscreen();
    } else if (element.msRequestFullscreen) { // IE/Edge
        return element.msRequestFullscreen();
    }
};

export const exitFullscreen = () => {
    if (document.exitFullscreen) {
        return document.exitFullscreen();
    } else if (document.mozCancelFullScreen) { // Firefox
        return document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) { // Chrome, Safari, Opera
        return document.webkitExitFullscreen();
    } else if (document.msExitFullscreen) { // IE/Edge
        return document.msExitFullscreen();
    }
};

export const checkFullscreen  = () => {
    return (
        document.fullscreenElement ||
        document.mozFullScreenElement ||
        document.webkitFullscreenElement ||
        document.msFullscreenElement
    );
};